Optimal. Leaf size=89 \[ -\frac {\left (2 a c d+b \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (2 b c d-a \left (c^2-d^2\right )\right )+\frac {d (a d+b c) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3528, 3525, 3475} \[ -\frac {\left (2 a c d+b \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (2 b c d-a \left (c^2-d^2\right )\right )+\frac {d (a d+b c) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3528
Rubi steps
\begin {align*} \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx &=\frac {b (c+d \tan (e+f x))^2}{2 f}+\int (c+d \tan (e+f x)) (a c-b d+(b c+a d) \tan (e+f x)) \, dx\\ &=-\left (2 b c d-a \left (c^2-d^2\right )\right ) x+\frac {d (b c+a d) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f}+\left (2 a c d+b \left (c^2-d^2\right )\right ) \int \tan (e+f x) \, dx\\ &=-\left (2 b c d-a \left (c^2-d^2\right )\right ) x-\frac {\left (2 a c d+b \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac {d (b c+a d) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.47, size = 96, normalized size = 1.08 \[ \frac {2 d (a d+2 b c) \tan (e+f x)+(b+i a) (c-i d)^2 \log (\tan (e+f x)+i)+(b-i a) (c+i d)^2 \log (-\tan (e+f x)+i)+b d^2 \tan ^2(e+f x)}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 91, normalized size = 1.02 \[ \frac {b d^{2} \tan \left (f x + e\right )^{2} + 2 \, {\left (a c^{2} - 2 \, b c d - a d^{2}\right )} f x - {\left (b c^{2} + 2 \, a c d - b d^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left (2 \, b c d + a d^{2}\right )} \tan \left (f x + e\right )}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.38, size = 968, normalized size = 10.88 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 151, normalized size = 1.70 \[ \frac {b \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {a \,d^{2} \tan \left (f x +e \right )}{f}+\frac {2 b c d \tan \left (f x +e \right )}{f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a c d}{f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c^{2} b}{2 f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b \,d^{2}}{2 f}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) a \,c^{2}}{f}-\frac {\arctan \left (\tan \left (f x +e \right )\right ) a \,d^{2}}{f}-\frac {2 \arctan \left (\tan \left (f x +e \right )\right ) b c d}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.86, size = 91, normalized size = 1.02 \[ \frac {b d^{2} \tan \left (f x + e\right )^{2} + 2 \, {\left (a c^{2} - 2 \, b c d - a d^{2}\right )} {\left (f x + e\right )} + {\left (b c^{2} + 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \, {\left (2 \, b c d + a d^{2}\right )} \tan \left (f x + e\right )}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.18, size = 91, normalized size = 1.02 \[ \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a\,d^2+2\,b\,c\,d\right )}{f}-x\,\left (-a\,c^2+2\,b\,c\,d+a\,d^2\right )+\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {b\,c^2}{2}+a\,c\,d-\frac {b\,d^2}{2}\right )}{f}+\frac {b\,d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.30, size = 143, normalized size = 1.61 \[ \begin {cases} a c^{2} x + \frac {a c d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} - a d^{2} x + \frac {a d^{2} \tan {\left (e + f x \right )}}{f} + \frac {b c^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 2 b c d x + \frac {2 b c d \tan {\left (e + f x \right )}}{f} - \frac {b d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \tan {\relax (e )}\right ) \left (c + d \tan {\relax (e )}\right )^{2} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________